#include "os.h"
#include "LED_Test.h"
#include <string.h>
#include <util/delay.h>
#include "kernel.h"
/*============
  * A Simple Test
  *============
  */
 
const unsigned char PPP []  = {'A', '50', 'B', '100'};
const unsigned int PT=2;

/**
  * A cooperative "Ping" task.
  * Added testing code for LEDs.
  */
void Ping()
{
  int  x ;
  init_LED_D5();
  for(;;){
  	//LED on
	enable_LED(LED_D5_GREEN);
	
	  for(x = 0; x < 30; ++x)
	  {
	 // 	_delay_ms(20);
	   }

	//LED off
	disable_LEDs();
    Task_Next();
  }
}


/**
  * A cooperative "Pong" task.
  * Added testing code for LEDs.
  */
void Pong()
{
  int  x;
  init_LED_D2();
  for(;;) {
	//LED on
	enable_LED(LED_D2_GREEN);
	
	
	for(x = 0; x < 30; ++x)
	{
	//  	_delay_ms(20);
	}

	//LED off
	disable_LEDs();
    Task_Next();

  }
}


/**
  * This function creates two cooperative tasks, "Ping" and "Pong". Both
  * will run forever.
  */
void main()
{
  initTimer();
 
  Task_Create(Ping, 0, PERIODIC, 'A');
  Task_Create(Pong,0, FCFS,'B');
  startTimer();
  
  Task_Next();


   
}

//Applications need to block or terminate on an event
